/*
 * File: concurrent_execution.h
 *
 * Code generated for Simulink model 'concurrent_execution'.
 *
 * Model version                  : 3.1
 * Simulink Coder version         : 9.5 (R2021a) 14-Nov-2020
 * C/C++ source code generated on : Tue Dec 21 10:52:34 2021
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef RTW_HEADER_concurrent_execution_h_
#define RTW_HEADER_concurrent_execution_h_
#include <string.h>
#include <stddef.h>
#ifndef concurrent_execution_COMMON_INCLUDES_
#define concurrent_execution_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                               /* concurrent_execution_COMMON_INCLUDES_ */

/* Child system includes */
#include "ss1.h"
#include "ss2.h"
#include "sumsys.h"
#include "integrator.h"

/* Model Code Variants */
#include "rtw_windows.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

#ifndef rtmGetErrorStatusPointer
#define rtmGetErrorStatusPointer(rtm)  ((const char_T **)(&((rtm)->errorStatus)))
#endif

#ifndef rtmStepTask
#define rtmStepTask(rtm, idx)          ((rtm)->Timing.TaskCounters.TID[(idx)] == 0)
#endif

#ifndef rtmTaskCounter
#define rtmTaskCounter(rtm, idx)       ((rtm)->Timing.TaskCounters.TID[(idx)])
#endif

/* Forward declaration for rtModel */
typedef struct tag_RTM RT_MODEL;

/* Block signals and states (default storage) for system '<Root>' */
typedef struct {
  integrator_MdlrefDW Integrator_InstanceData;/* '<Root>/Integrator' */
  ss1_MdlrefDW SS1_InstanceData;       /* '<Root>/SS1' */
  ss2_MdlrefDW SS2_InstanceData;       /* '<Root>/SS2' */
  sumsys_MdlrefDW Sum_InstanceData;    /* '<Root>/Sum' */
  real_T TmpRTBAtIntegratorOutport1_Buf[3];/* synthesized block */
  real_T TmpTaskTransAtSS1Outport1_buf_1[2];/* synthesized block */
  real_T TmpTaskTransAtSS2Outport1_buf_2[2];/* synthesized block */
  real_T Integrator;                   /* '<Root>/Integrator' */
  real_T TmpRTBAtIntegratorOutport1;   /* '<Root>/Integrator' */
  void* TmpRTBAtIntegratorOutport1_d0_SEMAPHORE;/* synthesized block */
  void* mw_buf_1;                      /* synthesized block */
  void* mw_buf_2;                      /* synthesized block */
  int_T fw_buf_1;                      /* synthesized block */
  int_T fr_buf_1;                      /* synthesized block */
  int_T fw_buf_2;                      /* synthesized block */
  int_T fr_buf_2;                      /* synthesized block */
  int8_T TmpRTBAtIntegratorOutport1_LstBufWR;/* synthesized block */
  int8_T TmpRTBAtIntegratorOutport1_RDBuf;/* synthesized block */
} DW;

/* Real-time Model Data Structure */
struct tag_RTM {
  const char_T *errorStatus;

  /*
   * Timing:
   * The following substructure contains information regarding
   * the timing information for the model.
   */
  struct {
    struct {
      uint32_T TID[2];
    } TaskCounters;
  } Timing;
};

/* Block signals and states (default storage) */
extern DW rtDW;

/*
 * Exported Global Signals
 *
 * Note: Exported global signals are block signals with an exported global
 * storage class designation.  Code generation will declare the memory for
 * these signals and export their symbols.
 *
 */
extern real_T In1_1s;                  /* '<Root>/In1_1s' */
extern real_T In2_2s;                  /* '<Root>/In2_2s' */
extern real_T Out2_1s;                 /* '<Root>/SS2' */
extern real_T Out1_1s;                 /* '<Root>/Sum' */
extern void AdvanceTaskCounters(void);

/* Model entry point functions */
extern void concurrent_execution_initialize(void);
extern void PeriodicTrigger1_OneSecond_step(void);
extern void PeriodicTrigger1_TwoSecond_step(void);
extern void PeriodicTrigger2_OneSecond_step(void);
extern void concurrent_execution_step(int_T tid);
extern void concurrent_execution_terminate(void);

/* Real-time Model object */
extern RT_MODEL *const rtM;

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'concurrent_execution'
 */
#endif                                 /* RTW_HEADER_concurrent_execution_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
